class CreatePointHis < ActiveRecord::Migration
  def self.up
    create_table :point_his do |t|
      t.integer :customer_id         #客户
      t.integer :user_id             ,:limit => 2 ,:default => 0#操作员
      
      t.string :options              ,:default=>'加',:limit => 10 #操作 加 减
      t.integer :point               ,:limit => 2,:default => 0 #积分
      t.integer :expenditure         ,:limit => 2 ,:default => 0 #消费
      t.integer :price               ,:limit => 2 ,:default => 0 #票面价
      t.integer :tax                 ,:limit => 2 ,:default => 0 #税款
      t.integer :fuel                ,:limit => 2 ,:default => 0 #附加
      
      t.string :remark               ,:default=>"",:limit => 100 #备注
      t.integer :is_locked           ,:limit => 1 ,:default => 0 #是否管理会要锁定 1为True 0为False
      t.integer :lock_version        ,:default => 0 #乐观锁
      t.timestamps
    end
  end

  def self.down
    drop_table :point_his
  end
end
